iT邦幫忙

2024 iThome 鐵人賽

DAY 1
0

前言

這次的參賽內容會從零開始完成一個自動化專案,目標對象是沒接觸過code的人,所以會從安裝環境開始逐步介紹。

使用工具

Python

本次使用的語言為Python,Python是一個簡單但功能強大的語言,豐富的套件讓Python的應用十分廣泛

Vscode

微軟開發的程式編輯器,功能強大且支援眾多語言。

Git

為分散式版本控制系統,在多人協作開發時十分方便。

安裝教學

  • 安裝 Python

    前往 Python 官網,下載最新版本的 Python。
    https://ithelp.ithome.com.tw/upload/images/20240915/201693587q97fsZBMc.png

    記得勾選 Add python.exe to PATH ,否則後續新增環境變數會很麻煩。
    勾選後點 Install Now
    https://ithelp.ithome.com.tw/upload/images/20240915/20169358FrN5CsNBpM.png
    https://ithelp.ithome.com.tw/upload/images/20240915/20169358lF8oQiCwnr.jpg
    下載完成後打開cmd,輸入
    python --version
    若有出現版本資訊代表安裝成功。
    https://ithelp.ithome.com.tw/upload/images/20240915/20169358dmSXsmnpRi.jpg

    安裝 VS code

    前往VS code 官網,選擇 Download for Windows
    https://ithelp.ithome.com.tw/upload/images/20240915/20169358YTL0AhKgpS.jpg
    安裝頁面到 選擇附加的動作記得要全部都勾選(尤其是下面的 加入 PATH 中)

https://ithelp.ithome.com.tw/upload/images/20240915/20169358ip5ppLeuqN.jpg
安裝完成後打開 VS code 選擇左側的延伸模組。

  • Chinese (Traditional) Language Pack for Visual Studio Code

    安裝後VS code 介面會變成繁體中文

  • Python
    VS code 對 Python 語言的支援,寫 Python 必裝

  • Python Indent
    Python 自動縮排

  • indent-rainbow
    縮排新增顏色區分

安裝完模組後新增資料夾,在資料夾內部新增一hello.py檔

https://ithelp.ithome.com.tw/upload/images/20240915/20169358T5ZjSZgg0v.jpg
在檔案內輸入

print('hello')

https://ithelp.ithome.com.tw/upload/images/20240915/201693586WYbCttWIf.jpg
在左上角的終端機選擇 新增終端機

https://ithelp.ithome.com.tw/upload/images/20240915/20169358S8xQN5dzk2.png
在終端機輸入

python hello.py

若輸出hello成功代表安裝成功

安裝 Git

前往 Git 官網選擇 Downloads
https://ithelp.ithome.com.tw/upload/images/20240915/20169358Chy0Z5FYq4.jpg
選擇右上角的 Download for Windows
https://ithelp.ithome.com.tw/upload/images/20240915/20169358Zt73PYTAPS.jpg
選擇 Click here to download
https://ithelp.ithome.com.tw/upload/images/20240915/20169358mys32kQhoO.jpg
打開安裝檔,一路 next

安裝完成後,打開 cmd 輸入

git --version

若出現安裝版本資訊代表安裝完成
https://ithelp.ithome.com.tw/upload/images/20240915/20169358IieM6W0oOF.jpg
明天預計會介紹常用的 Python 語法。


下一篇
D2 Python語法介紹
系列文
利用Python完成自動化測試專案12
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言